package com.bf.electroplating.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 企业排污阀操作日志表
 *
 * @author system
 * @since 2025-10-09
 */
@Getter
@Setter
@TableName("enterprise_outfall_valve_operation_log")
@Schema(description = "企业排污阀操作日志表")
public class EnterpriseOutfallValveOperationLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "ID")
    @TableId("ID")
    private String id;

    @Schema(description = "阀门ID")
    @TableField("VALVE_ID")
    private String valveId;

    @Schema(description = "阀门名称")
    @TableField("VALVE_NAME")
    private String valveName;

    @Schema(description = "企业ID")
    @TableField("COMPANY_ID")
    private String companyId;

    @Schema(description = "企业名称")
    @TableField("COMPANY_NAME")
    private String companyName;

    @Schema(description = "MN码")
    @TableField("MN_CODE")
    private String mnCode;

    // ==================== 操作信息 ====================
    @Schema(description = "操作类型：OPEN-开启,CLOSE-关闭,REMOTE_OPEN-远程开启,REMOTE_CLOSE-远程关闭")
    @TableField("OPERATION_TYPE")
    private String operationType;

    @Schema(description = "操作模式：MANUAL-手动,AUTO-自动,REMOTE-远程")
    @TableField("OPERATION_MODE")
    private String operationMode;

    @Schema(description = "操作指令")
    @TableField("OPERATION_CMD")
    private String operationCmd;

    @Schema(description = "操作结果：SUCCESS-成功,FAILED-失败,TIMEOUT-超时")
    @TableField("OPERATION_RESULT")
    private String operationResult;

    @Schema(description = "失败原因")
    @TableField("FAILURE_REASON")
    private String failureReason;

    // ==================== 状态变化 ====================
    @Schema(description = "操作前状态")
    @TableField("STATUS_BEFORE")
    private String statusBefore;

    @Schema(description = "操作后状态")
    @TableField("STATUS_AFTER")
    private String statusAfter;

    // ==================== 时间信息 ====================
    @Schema(description = "操作时间")
    @TableField("OPERATION_TIME")
    private LocalDateTime operationTime;

    @Schema(description = "指令发送时间")
    @TableField("CMD_SEND_TIME")
    private LocalDateTime cmdSendTime;

    @Schema(description = "指令响应时间")
    @TableField("CMD_RESPONSE_TIME")
    private LocalDateTime cmdResponseTime;

    @Schema(description = "执行耗时(秒)")
    @TableField("DURATION")
    private Integer duration;

    // ==================== 操作人信息 ====================
    @Schema(description = "操作人")
    @TableField("OPERATOR")
    private String operator;

    @Schema(description = "操作人IP")
    @TableField("OPERATOR_IP")
    private String operatorIp;

    @Schema(description = "操作人类型：USER-用户,SYSTEM-系统")
    @TableField("OPERATOR_TYPE")
    private String operatorType;

    // ==================== 系统字段 ====================
    @Schema(description = "创建时间")
    @TableField("CREATE_TIME")
    private LocalDateTime createTime;

    @Schema(description = "备注")
    @TableField("REMARK")
    private String remark;
}

